import { legacy_createStore, combineReducers } from "redux"
import { userReducer } from "./modules/user"
// 持久化存储
import { persistReducer, persistStore } from 'redux-persist';
import storageSession from 'redux-persist/lib/storage/session';  //

const persistConfig = {
    key: 'storeReudx',  //
    storage: storageSession,  //指定存储到session中
}

// 
const reducers = combineReducers({
    user: userReducer
})


const myPersistReducer = persistReducer(persistConfig, reducers)


const store = legacy_createStore(myPersistReducer)

export const persistor = persistStore(store)

export default store